package com.google.android.material.chip;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Outline;
import android.graphics.PorterDuff.Mode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.TextUtils.TruncateAt;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.PointerIcon;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewOutlineProvider;
import android.view.ViewParent;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.TextView.BufferType;
import androidx.annotation.AnimatorRes;
import androidx.annotation.BoolRes;
import androidx.annotation.CallSuper;
import androidx.annotation.ColorRes;
import androidx.annotation.DimenRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Px;
import androidx.annotation.StringRes;
import androidx.annotation.StyleRes;
import androidx.appcompat.widget.AppCompatCheckBox;
import androidx.core.view.ViewCompat;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.List;
import o.aqu;
import o.aqu.f;
import o.aqu.h;
import o.aqz;
import o.arl;
import o.arl.c;
import o.asg;
import o.ash;
import o.asl;
import o.fc;
import o.fv.d;
import o.gu;
import o.in;
import o.in.b;
import o.jb;

public class Chip extends AppCompatCheckBox implements c {
    private static final int[] ˎ = new int[]{16842913};
    private static final Rect ˏ = new Rect();
    private boolean ʻ;
    private boolean ʼ;
    @Nullable
    private OnCheckedChangeListener ʽ;
    @Nullable
    private OnClickListener ˊ;
    private final RectF ˊॱ;
    @Nullable
    private RippleDrawable ˋ;
    private final a ˋॱ;
    private final Rect ˏॱ;
    private final d ͺ;
    @Nullable
    private arl ॱ;
    private boolean ॱˊ;
    private int ॱॱ;
    private boolean ᐝ;

    class a extends jb {
        final /* synthetic */ Chip ॱ;

        a(Chip chip, Chip chip2) {
            this.ॱ = chip;
            super(chip2);
        }

        public int ˊ(float f, float f2) {
            return (this.ॱ.ॱˊ() && this.ॱ.ˋॱ().contains(f, f2)) ? 0 : -1;
        }

        public void ˎ(List<Integer> list) {
            if (this.ॱ.ॱˊ()) {
                list.add(Integer.valueOf(0));
            }
        }

        public void ॱ(int i, in inVar) {
            if (this.ॱ.ॱˊ()) {
                CharSequence ˎ = this.ॱ.ˎ();
                if (ˎ != null) {
                    inVar.ॱ(ˎ);
                } else {
                    ˎ = this.ॱ.getText();
                    Context context = this.ॱ.getContext();
                    int i2 = h.ˏ;
                    Object[] objArr = new Object[1];
                    if (TextUtils.isEmpty(ˎ)) {
                        ˎ = "";
                    }
                    objArr[0] = ˎ;
                    inVar.ॱ(context.getString(i2, objArr).trim());
                }
                inVar.ˊ(this.ॱ.ͺ());
                inVar.ˏ(b.ˊ);
                inVar.ᐝ(this.ॱ.isEnabled());
                return;
            }
            inVar.ॱ("");
            inVar.ˊ(Chip.ˏ);
        }

        public void ˋ(in inVar) {
            boolean z = this.ॱ.ॱ != null && this.ॱ.ॱ.ॱᐝ();
            inVar.ˏ(z);
            inVar.ˏ(Chip.class.getName());
            CharSequence text = this.ॱ.getText();
            if (VERSION.SDK_INT >= 23) {
                inVar.ˋ(text);
            } else {
                inVar.ॱ(text);
            }
        }

        public boolean ॱ(int i, int i2, Bundle bundle) {
            if (i2 == 16 && i == 0) {
                return this.ॱ.ˊ();
            }
            return false;
        }
    }

    public Chip(Context context) {
        this(context, null);
    }

    public Chip(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, aqu.d.ॱ);
    }

    public Chip(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.ॱॱ = Integer.MIN_VALUE;
        this.ˏॱ = new Rect();
        this.ˊॱ = new RectF();
        this.ͺ = new d(this) {
            final /* synthetic */ Chip ˎ;

            {
                this.ˎ = r1;
            }

            public void ˎ(@NonNull Typeface typeface) {
                this.ˎ.setText(this.ˎ.getText());
                this.ˎ.requestLayout();
                this.ˎ.invalidate();
            }

            public void ˋ(int i) {
            }
        };
        ॱ(attributeSet);
        arl ॱ = arl.ॱ(context, attributeSet, i, f.ॱˋ);
        setChipDrawable(ॱ);
        this.ˋॱ = new a(this, this);
        ViewCompat.ˏ(this, this.ˋॱ);
        ॱॱ();
        setChecked(this.ʼ);
        ॱ.ॱॱ(false);
        setText(ॱ.ʽ());
        setEllipsize(ॱ.ʻ());
        setIncludeFontPadding(false);
        if (ˊॱ() != null) {
            ˊ(ˊॱ());
        }
        setSingleLine();
        setGravity(8388627);
        ᐝ();
    }

    private void ᐝ() {
        if (!TextUtils.isEmpty(getText()) && this.ॱ != null) {
            float ॱˋ = ((this.ॱ.ॱˋ() + this.ॱ.ˊˋ()) + this.ॱ.ˈ()) + this.ॱ.ʼॱ();
            if ((this.ॱ.ᐝ() && this.ॱ.ॱॱ() != null) || (this.ॱ.ʻॱ() != null && this.ॱ.ॱˎ() && isChecked())) {
                ॱˋ += (this.ॱ.ᐝॱ() + this.ॱ.ʾ()) + this.ॱ.ˏॱ();
            }
            if (this.ॱ.ͺ() && this.ॱ.ॱˊ() != null) {
                ॱˋ += (this.ॱ.ʿ() + this.ॱ.ʽॱ()) + this.ॱ.ˋॱ();
            }
            if (((float) ViewCompat.ᐝ(this)) != ॱˋ) {
                ViewCompat.ˏ(this, ViewCompat.ʻ(this), getPaddingTop(), (int) ॱˋ, getPaddingBottom());
            }
        }
    }

    private void ॱ(@Nullable AttributeSet attributeSet) {
        if (attributeSet != null) {
            if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "background") != null) {
                throw new UnsupportedOperationException("Do not set the background; Chip manages its own background drawable.");
            } else if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableLeft") != null) {
                throw new UnsupportedOperationException("Please set left drawable using R.attr#chipIcon.");
            } else if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableStart") != null) {
                throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
            } else if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableEnd") != null) {
                throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
            } else if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableRight") != null) {
                throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
            } else if (!attributeSet.getAttributeBooleanValue("http://schemas.android.com/apk/res/android", "singleLine", true) || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "lines", 1) != 1 || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "minLines", 1) != 1 || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "maxLines", 1) != 1) {
                throw new UnsupportedOperationException("Chip does not support multi-line text");
            } else if (attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "gravity", 8388627) != 8388627) {
                Log.w("Chip", "Chip text must be vertically center and start aligned");
            }
        }
    }

    private void ॱॱ() {
        if (VERSION.SDK_INT >= 21) {
            setOutlineProvider(new ViewOutlineProvider(this) {
                final /* synthetic */ Chip ˏ;

                {
                    this.ˏ = r1;
                }

                @TargetApi(21)
                public void getOutline(View view, Outline outline) {
                    if (this.ˏ.ॱ != null) {
                        this.ˏ.ॱ.getOutline(outline);
                    } else {
                        outline.setAlpha(0.0f);
                    }
                }
            });
        }
    }

    public void setChipDrawable(@NonNull arl o_arl) {
        if (this.ॱ != o_arl) {
            ˎ(this.ॱ);
            this.ॱ = o_arl;
            ˋ(this.ॱ);
            if (asl.ˋ) {
                this.ˋ = new RippleDrawable(asl.ˎ(this.ॱ.ॱ()), this.ॱ, null);
                this.ॱ.ˎ(false);
                ViewCompat.ˏ(this, this.ˋ);
                return;
            }
            this.ॱ.ˎ(true);
            ViewCompat.ˏ(this, this.ॱ);
        }
    }

    private void ˎ(@Nullable arl o_arl) {
        if (o_arl != null) {
            o_arl.ˎ(null);
        }
    }

    private void ˋ(@NonNull arl o_arl) {
        o_arl.ˎ((c) this);
    }

    protected int[] onCreateDrawableState(int i) {
        int[] onCreateDrawableState = super.onCreateDrawableState(i + 1);
        if (isChecked()) {
            mergeDrawableStates(onCreateDrawableState, ˎ);
        }
        return onCreateDrawableState;
    }

    protected void onDraw(Canvas canvas) {
        if (TextUtils.isEmpty(getText()) || this.ॱ == null || this.ॱ.ˊᐝ()) {
            super.onDraw(canvas);
            return;
        }
        int save = canvas.save();
        canvas.translate(ˊ(this.ॱ), 0.0f);
        super.onDraw(canvas);
        canvas.restoreToCount(save);
    }

    public void setGravity(int i) {
        if (i != 8388627) {
            Log.w("Chip", "Chip text must be vertically center and start aligned");
        } else {
            super.setGravity(i);
        }
    }

    private float ˊ(@NonNull arl o_arl) {
        float ˏ = (ˏ() + o_arl.ˏ()) + ॱ();
        return ViewCompat.ʼ(this) == 0 ? ˏ : -ˏ;
    }

    public void setBackgroundTintList(@Nullable ColorStateList colorStateList) {
        throw new UnsupportedOperationException("Do not set the background tint list; Chip manages its own background drawable.");
    }

    public void setBackgroundTintMode(@Nullable Mode mode) {
        throw new UnsupportedOperationException("Do not set the background tint mode; Chip manages its own background drawable.");
    }

    public void setBackgroundColor(int i) {
        throw new UnsupportedOperationException("Do not set the background color; Chip manages its own background drawable.");
    }

    public void setBackgroundResource(int i) {
        throw new UnsupportedOperationException("Do not set the background resource; Chip manages its own background drawable.");
    }

    public void setBackground(Drawable drawable) {
        if (drawable == this.ॱ || drawable == this.ˋ) {
            super.setBackground(drawable);
            return;
        }
        throw new UnsupportedOperationException("Do not set the background; Chip manages its own background drawable.");
    }

    public void setBackgroundDrawable(Drawable drawable) {
        if (drawable == this.ॱ || drawable == this.ˋ) {
            super.setBackgroundDrawable(drawable);
            return;
        }
        throw new UnsupportedOperationException("Do not set the background drawable; Chip manages its own background drawable.");
    }

    public void setCompoundDrawables(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        } else if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        } else {
            super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        }
    }

    public void setCompoundDrawablesWithIntrinsicBounds(int i, int i2, int i3, int i4) {
        if (i != 0) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        } else if (i3 != 0) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        } else {
            super.setCompoundDrawablesWithIntrinsicBounds(i, i2, i3, i4);
        }
    }

    public void setCompoundDrawablesWithIntrinsicBounds(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set left drawable using R.attr#chipIcon.");
        } else if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set right drawable using R.attr#closeIcon.");
        } else {
            super.setCompoundDrawablesWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
        }
    }

    public void setCompoundDrawablesRelative(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        } else if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        } else {
            super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        }
    }

    public void setCompoundDrawablesRelativeWithIntrinsicBounds(int i, int i2, int i3, int i4) {
        if (i != 0) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        } else if (i3 != 0) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        } else {
            super.setCompoundDrawablesRelativeWithIntrinsicBounds(i, i2, i3, i4);
        }
    }

    public void setCompoundDrawablesRelativeWithIntrinsicBounds(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        } else if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        } else {
            super.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
        }
    }

    public TruncateAt getEllipsize() {
        return this.ॱ != null ? this.ॱ.ʻ() : null;
    }

    public void setEllipsize(TruncateAt truncateAt) {
        if (this.ॱ != null) {
            if (truncateAt == TruncateAt.MARQUEE) {
                throw new UnsupportedOperationException("Text within a chip are not allowed to scroll.");
            }
            super.setEllipsize(truncateAt);
            if (this.ॱ != null) {
                this.ॱ.ˋ(truncateAt);
            }
        }
    }

    public void setSingleLine(boolean z) {
        if (z) {
            super.setSingleLine(z);
            return;
        }
        throw new UnsupportedOperationException("Chip does not support multi-line text");
    }

    public void setLines(int i) {
        if (i > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setLines(i);
    }

    public void setMinLines(int i) {
        if (i > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setMinLines(i);
    }

    public void setMaxLines(int i) {
        if (i > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setMaxLines(i);
    }

    public void setMaxWidth(@Px int i) {
        super.setMaxWidth(i);
        if (this.ॱ != null) {
            this.ॱ.ˉ(i);
        }
    }

    public void ˋ() {
        ᐝ();
        requestLayout();
        if (VERSION.SDK_INT >= 21) {
            invalidateOutline();
        }
    }

    public void setChecked(boolean z) {
        if (this.ॱ == null) {
            this.ʼ = z;
        } else if (this.ॱ.ॱᐝ()) {
            boolean isChecked = isChecked();
            super.setChecked(z);
            if (isChecked != z && this.ʽ != null) {
                this.ʽ.onCheckedChanged(this, z);
            }
        }
    }

    void ˋ(OnCheckedChangeListener onCheckedChangeListener) {
        this.ʽ = onCheckedChangeListener;
    }

    public void setOnCloseIconClickListener(OnClickListener onClickListener) {
        this.ˊ = onClickListener;
    }

    @CallSuper
    public boolean ˊ() {
        boolean z;
        playSoundEffect(0);
        if (this.ˊ != null) {
            this.ˊ.onClick(this);
            z = true;
        } else {
            z = false;
        }
        this.ˋॱ.ˎ(0, 1);
        return z;
    }

    /* JADX WARNING: inconsistent code. */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public boolean onTouchEvent(android.view.MotionEvent r7) {
        /*
        r6 = this;
        r2 = 0;
        r1 = 1;
        r0 = r7.getActionMasked();
        r3 = r6.ˋॱ();
        r4 = r7.getX();
        r5 = r7.getY();
        r3 = r3.contains(r4, r5);
        switch(r0) {
            case 0: goto L_0x0024;
            case 1: goto L_0x0036;
            case 2: goto L_0x002b;
            case 3: goto L_0x0042;
            default: goto L_0x0019;
        };
    L_0x0019:
        r0 = r2;
    L_0x001a:
        if (r0 != 0) goto L_0x0022;
    L_0x001c:
        r0 = super.onTouchEvent(r7);
        if (r0 == 0) goto L_0x0023;
    L_0x0022:
        r2 = r1;
    L_0x0023:
        return r2;
    L_0x0024:
        if (r3 == 0) goto L_0x0019;
    L_0x0026:
        r6.ˊ(r1);
        r0 = r1;
        goto L_0x001a;
    L_0x002b:
        r0 = r6.ʻ;
        if (r0 == 0) goto L_0x0019;
    L_0x002f:
        if (r3 != 0) goto L_0x0034;
    L_0x0031:
        r6.ˊ(r2);
    L_0x0034:
        r0 = r1;
        goto L_0x001a;
    L_0x0036:
        r0 = r6.ʻ;
        if (r0 == 0) goto L_0x0042;
    L_0x003a:
        r6.ˊ();
        r0 = r1;
    L_0x003e:
        r6.ˊ(r2);
        goto L_0x001a;
    L_0x0042:
        r0 = r2;
        goto L_0x003e;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.chip.Chip.onTouchEvent(android.view.MotionEvent):boolean");
    }

    public boolean onHoverEvent(MotionEvent motionEvent) {
        switch (motionEvent.getActionMasked()) {
            case 7:
                ॱ(ˋॱ().contains(motionEvent.getX(), motionEvent.getY()));
                break;
            case 10:
                ॱ(false);
                break;
        }
        return super.onHoverEvent(motionEvent);
    }

    @SuppressLint({"PrivateApi"})
    private boolean ˊ(MotionEvent motionEvent) {
        if (motionEvent.getAction() == 10) {
            try {
                Field declaredField = jb.class.getDeclaredField("ˊॱ");
                declaredField.setAccessible(true);
                if (((Integer) declaredField.get(this.ˋॱ)).intValue() != Integer.MIN_VALUE) {
                    Method declaredMethod = jb.class.getDeclaredMethod("ॱ", new Class[]{Integer.TYPE});
                    declaredMethod.setAccessible(true);
                    declaredMethod.invoke(this.ˋॱ, new Object[]{Integer.valueOf(Integer.MIN_VALUE)});
                    return true;
                }
            } catch (Throwable e) {
                Log.e("Chip", "Unable to send Accessibility Exit event", e);
            } catch (Throwable e2) {
                Log.e("Chip", "Unable to send Accessibility Exit event", e2);
            } catch (Throwable e22) {
                Log.e("Chip", "Unable to send Accessibility Exit event", e22);
            } catch (Throwable e222) {
                Log.e("Chip", "Unable to send Accessibility Exit event", e222);
            }
        }
        return false;
    }

    protected boolean dispatchHoverEvent(MotionEvent motionEvent) {
        return ˊ(motionEvent) || this.ˋॱ.ˏ(motionEvent) || super.dispatchHoverEvent(motionEvent);
    }

    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        return this.ˋॱ.ˋ(keyEvent) || super.dispatchKeyEvent(keyEvent);
    }

    protected void onFocusChanged(boolean z, int i, Rect rect) {
        if (z) {
            ॱ(-1);
        } else {
            ॱ(Integer.MIN_VALUE);
        }
        invalidate();
        super.onFocusChanged(z, i, rect);
        this.ˋॱ.ॱ(z, i, rect);
    }

    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        boolean z = false;
        switch (keyEvent.getKeyCode()) {
            case 21:
                if (keyEvent.hasNoModifiers()) {
                    z = ˋ(ash.ˊ(this));
                    break;
                }
                break;
            case 22:
                if (keyEvent.hasNoModifiers()) {
                    if (!ash.ˊ(this)) {
                        z = true;
                    }
                    z = ˋ(z);
                    break;
                }
                break;
            case 23:
            case fc.c.ꓸॱ /*66*/:
                switch (this.ॱॱ) {
                    case -1:
                        performClick();
                        return true;
                    case 0:
                        ˊ();
                        return true;
                    default:
                        break;
                }
            case fc.c.ᵢ /*61*/:
                int i2;
                if (keyEvent.hasNoModifiers()) {
                    i2 = 2;
                } else if (keyEvent.hasModifiers(1)) {
                    i2 = 1;
                } else {
                    i2 = 0;
                }
                if (i2 != 0) {
                    ViewParent parent = getParent();
                    View view = this;
                    do {
                        view = view.focusSearch(i2);
                        if (view == null || view == this) {
                            if (view != null) {
                                view.requestFocus();
                                return true;
                            }
                        }
                    } while (view.getParent() == parent);
                    if (view != null) {
                        view.requestFocus();
                        return true;
                    }
                }
                break;
        }
        if (!z) {
            return super.onKeyDown(i, keyEvent);
        }
        invalidate();
        return true;
    }

    private boolean ˋ(boolean z) {
        ʻ();
        if (z) {
            if (this.ॱॱ == -1) {
                ॱ(0);
                return true;
            }
        } else if (this.ॱॱ == 0) {
            ॱ(-1);
            return true;
        }
        return false;
    }

    private void ʻ() {
        if (this.ॱॱ == Integer.MIN_VALUE) {
            ॱ(-1);
        }
    }

    public void getFocusedRect(Rect rect) {
        if (this.ॱॱ == 0) {
            rect.set(ͺ());
        } else {
            super.getFocusedRect(rect);
        }
    }

    private void ॱ(int i) {
        if (this.ॱॱ != i) {
            if (this.ॱॱ == 0) {
                ˏ(false);
            }
            this.ॱॱ = i;
            if (i == 0) {
                ˏ(true);
            }
        }
    }

    private void ˊ(boolean z) {
        if (this.ʻ != z) {
            this.ʻ = z;
            refreshDrawableState();
        }
    }

    private void ॱ(boolean z) {
        if (this.ᐝ != z) {
            this.ᐝ = z;
            refreshDrawableState();
        }
    }

    private void ˏ(boolean z) {
        if (this.ॱˊ != z) {
            this.ॱˊ = z;
            refreshDrawableState();
        }
    }

    protected void drawableStateChanged() {
        super.drawableStateChanged();
        boolean z = false;
        if (this.ॱ != null && this.ॱ.ˎ()) {
            z = this.ॱ.ˏ(ʽ());
        }
        if (z) {
            invalidate();
        }
    }

    private int[] ʽ() {
        int i;
        int i2 = 1;
        if (isEnabled()) {
            i = 1;
        } else {
            i = 0;
        }
        if (this.ॱˊ) {
            i++;
        }
        if (this.ᐝ) {
            i++;
        }
        if (this.ʻ) {
            i++;
        }
        if (isChecked()) {
            i++;
        }
        int[] iArr = new int[i];
        if (isEnabled()) {
            iArr[0] = 16842910;
        } else {
            i2 = 0;
        }
        if (this.ॱˊ) {
            iArr[i2] = 16842908;
            i2++;
        }
        if (this.ᐝ) {
            iArr[i2] = 16843623;
            i2++;
        }
        if (this.ʻ) {
            iArr[i2] = 16842919;
            i2++;
        }
        if (isChecked()) {
            iArr[i2] = 16842913;
            i2++;
        }
        return iArr;
    }

    private boolean ॱˊ() {
        return (this.ॱ == null || this.ॱ.ॱˊ() == null) ? false : true;
    }

    private RectF ˋॱ() {
        this.ˊॱ.setEmpty();
        if (ॱˊ()) {
            this.ॱ.ˎ(this.ˊॱ);
        }
        return this.ˊॱ;
    }

    private Rect ͺ() {
        RectF ˋॱ = ˋॱ();
        this.ˏॱ.set((int) ˋॱ.left, (int) ˋॱ.top, (int) ˋॱ.right, (int) ˋॱ.bottom);
        return this.ˏॱ;
    }

    @TargetApi(24)
    public PointerIcon onResolvePointerIcon(MotionEvent motionEvent, int i) {
        if (ˋॱ().contains(motionEvent.getX(), motionEvent.getY()) && isEnabled()) {
            return PointerIcon.getSystemIcon(getContext(), 1002);
        }
        return null;
    }

    public void setChipBackgroundColorResource(@ColorRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˊ(i);
        }
    }

    public void setChipBackgroundColor(@Nullable ColorStateList colorStateList) {
        if (this.ॱ != null) {
            this.ॱ.ˏ(colorStateList);
        }
    }

    public void setChipMinHeightResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˎ(i);
        }
    }

    public void setChipMinHeight(float f) {
        if (this.ॱ != null) {
            this.ॱ.ˋ(f);
        }
    }

    public void setChipCornerRadiusResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˏ(i);
        }
    }

    public void setChipCornerRadius(float f) {
        if (this.ॱ != null) {
            this.ॱ.ˊ(f);
        }
    }

    public void setChipStrokeColorResource(@ColorRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ॱ(i);
        }
    }

    public void setChipStrokeColor(@Nullable ColorStateList colorStateList) {
        if (this.ॱ != null) {
            this.ॱ.ˋ(colorStateList);
        }
    }

    public void setChipStrokeWidthResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˋ(i);
        }
    }

    public void setChipStrokeWidth(float f) {
        if (this.ॱ != null) {
            this.ॱ.ˎ(f);
        }
    }

    public void setRippleColorResource(@ColorRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ʽ(i);
        }
    }

    public void setRippleColor(@Nullable ColorStateList colorStateList) {
        if (this.ॱ != null) {
            this.ॱ.ॱ(colorStateList);
        }
    }

    public CharSequence getText() {
        return this.ॱ != null ? this.ॱ.ʽ() : "";
    }

    public void setText(CharSequence charSequence, BufferType bufferType) {
        if (this.ॱ != null) {
            if (charSequence == null) {
                charSequence = "";
            }
            CharSequence ˋ = gu.ˏ().ˋ(charSequence);
            if (this.ॱ.ˊᐝ()) {
                ˋ = null;
            }
            super.setText(ˋ, bufferType);
            if (this.ॱ != null) {
                this.ॱ.ˋ(charSequence);
            }
        }
    }

    @Deprecated
    public void setChipTextResource(@StringRes int i) {
        setText(getResources().getString(i));
    }

    @Deprecated
    public void setChipText(@Nullable CharSequence charSequence) {
        setText(charSequence);
    }

    @Nullable
    private asg ˊॱ() {
        return this.ॱ != null ? this.ॱ.ʼ() : null;
    }

    private void ˊ(asg o_asg) {
        TextPaint paint = getPaint();
        paint.drawableState = this.ॱ.getState();
        o_asg.ˎ(getContext(), paint, this.ͺ);
    }

    public void setTextAppearanceResource(@StyleRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ʻ(i);
        }
        setTextAppearance(getContext(), i);
    }

    public void setTextAppearance(@Nullable asg o_asg) {
        if (this.ॱ != null) {
            this.ॱ.ˎ(o_asg);
        }
        if (ˊॱ() != null) {
            ˊॱ().ˊ(getContext(), getPaint(), this.ͺ);
            ˊ(o_asg);
        }
    }

    public void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        if (this.ॱ != null) {
            this.ॱ.ʻ(i);
        }
        if (ˊॱ() != null) {
            ˊॱ().ˊ(context, getPaint(), this.ͺ);
            ˊ(ˊॱ());
        }
    }

    public void setTextAppearance(int i) {
        super.setTextAppearance(i);
        if (this.ॱ != null) {
            this.ॱ.ʻ(i);
        }
        if (ˊॱ() != null) {
            ˊॱ().ˊ(getContext(), getPaint(), this.ͺ);
            ˊ(ˊॱ());
        }
    }

    public void setChipIconVisible(@BoolRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ॱॱ(i);
        }
    }

    public void setChipIconVisible(boolean z) {
        if (this.ॱ != null) {
            this.ॱ.ˏ(z);
        }
    }

    @Deprecated
    public void setChipIconEnabledResource(@BoolRes int i) {
        setChipIconVisible(i);
    }

    @Deprecated
    public void setChipIconEnabled(boolean z) {
        setChipIconVisible(z);
    }

    public void setChipIconResource(@DrawableRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ᐝ(i);
        }
    }

    public void setChipIcon(@Nullable Drawable drawable) {
        if (this.ॱ != null) {
            this.ॱ.ˏ(drawable);
        }
    }

    public void setChipIconTintResource(@ColorRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ʼ(i);
        }
    }

    public void setChipIconTint(@Nullable ColorStateList colorStateList) {
        if (this.ॱ != null) {
            this.ॱ.ˊ(colorStateList);
        }
    }

    public void setChipIconSizeResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˋॱ(i);
        }
    }

    public void setChipIconSize(float f) {
        if (this.ॱ != null) {
            this.ॱ.ॱ(f);
        }
    }

    public void setCloseIconVisible(@BoolRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ॱˊ(i);
        }
    }

    public void setCloseIconVisible(boolean z) {
        if (this.ॱ != null) {
            this.ॱ.ॱ(z);
        }
    }

    @Deprecated
    public void setCloseIconEnabledResource(@BoolRes int i) {
        setCloseIconVisible(i);
    }

    @Deprecated
    public void setCloseIconEnabled(boolean z) {
        setCloseIconVisible(z);
    }

    public void setCloseIconResource(@DrawableRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˏॱ(i);
        }
    }

    public void setCloseIcon(@Nullable Drawable drawable) {
        if (this.ॱ != null) {
            this.ॱ.ˋ(drawable);
        }
    }

    public void setCloseIconTintResource(@ColorRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˊॱ(i);
        }
    }

    public void setCloseIconTint(@Nullable ColorStateList colorStateList) {
        if (this.ॱ != null) {
            this.ॱ.ˎ(colorStateList);
        }
    }

    public void setCloseIconSizeResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ͺ(i);
        }
    }

    public void setCloseIconSize(float f) {
        if (this.ॱ != null) {
            this.ॱ.ˏ(f);
        }
    }

    public void setCloseIconContentDescription(@Nullable CharSequence charSequence) {
        if (this.ॱ != null) {
            this.ॱ.ˎ(charSequence);
        }
    }

    @Nullable
    public CharSequence ˎ() {
        return this.ॱ != null ? this.ॱ.ˊॱ() : null;
    }

    public void setCheckableResource(@BoolRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ॱᐝ(i);
        }
    }

    public void setCheckable(boolean z) {
        if (this.ॱ != null) {
            this.ॱ.ˊ(z);
        }
    }

    public void setCheckedIconVisible(@BoolRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ॱˋ(i);
        }
    }

    public void setCheckedIconVisible(boolean z) {
        if (this.ॱ != null) {
            this.ॱ.ˋ(z);
        }
    }

    @Deprecated
    public void setCheckedIconEnabledResource(@BoolRes int i) {
        setCheckedIconVisible(i);
    }

    @Deprecated
    public void setCheckedIconEnabled(boolean z) {
        setCheckedIconVisible(z);
    }

    public void setCheckedIconResource(@DrawableRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ʻॱ(i);
        }
    }

    public void setCheckedIcon(@Nullable Drawable drawable) {
        if (this.ॱ != null) {
            this.ॱ.ˎ(drawable);
        }
    }

    public void setShowMotionSpecResource(@AnimatorRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ॱˎ(i);
        }
    }

    public void setShowMotionSpec(@Nullable aqz o_aqz) {
        if (this.ॱ != null) {
            this.ॱ.ˋ(o_aqz);
        }
    }

    public void setHideMotionSpecResource(@AnimatorRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ᐝॱ(i);
        }
    }

    public void setHideMotionSpec(@Nullable aqz o_aqz) {
        if (this.ॱ != null) {
            this.ॱ.ˎ(o_aqz);
        }
    }

    public float ˏ() {
        return this.ॱ != null ? this.ॱ.ॱˋ() : 0.0f;
    }

    public void setChipStartPaddingResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ʽॱ(i);
        }
    }

    public void setChipStartPadding(float f) {
        if (this.ॱ != null) {
            this.ॱ.ᐝ(f);
        }
    }

    public void setIconStartPaddingResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˈ(i);
        }
    }

    public void setIconStartPadding(float f) {
        if (this.ॱ != null) {
            this.ॱ.ॱॱ(f);
        }
    }

    public void setIconEndPaddingResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ʿ(i);
        }
    }

    public void setIconEndPadding(float f) {
        if (this.ॱ != null) {
            this.ॱ.ʼ(f);
        }
    }

    public float ॱ() {
        return this.ॱ != null ? this.ॱ.ˈ() : 0.0f;
    }

    public void setTextStartPaddingResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ʾ(i);
        }
    }

    public void setTextStartPadding(float f) {
        if (this.ॱ != null) {
            this.ॱ.ʻ(f);
        }
    }

    public void setTextEndPaddingResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ʼॱ(i);
        }
    }

    public void setTextEndPadding(float f) {
        if (this.ॱ != null) {
            this.ॱ.ʽ(f);
        }
    }

    public void setCloseIconStartPaddingResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˋˊ(i);
        }
    }

    public void setCloseIconStartPadding(float f) {
        if (this.ॱ != null) {
            this.ॱ.ˏॱ(f);
        }
    }

    public void setCloseIconEndPaddingResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˊᐝ(i);
        }
    }

    public void setCloseIconEndPadding(float f) {
        if (this.ॱ != null) {
            this.ॱ.ॱˊ(f);
        }
    }

    public void setChipEndPaddingResource(@DimenRes int i) {
        if (this.ॱ != null) {
            this.ॱ.ˊˊ(i);
        }
    }

    public void setChipEndPadding(float f) {
        if (this.ॱ != null) {
            this.ॱ.ͺ(f);
        }
    }
}
